package com.moonshine.parser.evaluators;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.moonshine.parser.models.AS3Signature;
import com.moonshine.parser.models.ClassBaseSignature;
import com.moonshine.parser.models.ClassSignature;
import com.moonshine.parser.models.Flags;
import com.moonshine.parser.models.ImportSignature;
import com.moonshine.parser.models.InterfaceSignature;
import com.moonshine.parser.models.MethodSignature;
import com.moonshine.parser.models.VariableSignature;

import flex2.compiler.as3.reflect.NodeMagic;

import macromedia.asc.parser.*;
import macromedia.asc.semantics.Value;
import macromedia.asc.util.Context;
import static macromedia.asc.parser.Tokens.*;

public class MoonshineSignatureEvaluator implements Evaluator {
	private PrintWriter out;

	private String mExtendedClass;

	private List<ClassBaseSignature> classes = new ArrayList<ClassBaseSignature>();

	private ClassSignature currentClassScope;

	private List<ImportSignature> pendingImports = new ArrayList<ImportSignature>();

	private void reset() {
		currentClassScope = null;
		classes.clear();
		pendingImports.clear();

	}

	public List<ClassBaseSignature> getClasses() {
		return new ArrayList<ClassBaseSignature>(classes);

	}

	private void separate() {
		// out.print(" ");
	}

	public MoonshineSignatureEvaluator(PrintWriter out) {
		this.out = out;
	}

	public MoonshineSignatureEvaluator() {
		// TODO Auto-generated constructor stub
		this(new PrintWriter(System.out, true));

	}

	public String getSignature() {
		return getSignature(true);
	}

	public String getSignature(Boolean pretty) {
		StringBuilder sb = new StringBuilder();
		// appendToSignature(pretty, sb, mImports);
		// appendToSignature(pretty, sb, mVariables);
		// appendToSignature(pretty, sb, mMethods);

		return sb.toString();
	}

	private void appendToSignature(Boolean pretty, StringBuilder sb,
			List<AS3Signature> sigs) {
		for (AS3Signature sig : sigs) {
			sb.append(sig.toString(pretty) + "\n");
		}

	}

	@Override
	public boolean checkFeature(Context cx, Node node) {
		// TODO Auto-generated method stub
		return true;
	}

	public Value evaluate(Context cx, ProgramNode node) {
		reset();
		// TODO Auto-generated method stub

		// currentClassScope
		if (node.clsdefs != null && node.clsdefs.size() > 0) {
			for (ClassDefinitionNode cn : node.clsdefs)
				cn.evaluate(cx, this);
		}

		// node.pkgdefs
		if (node.statements != null) {
			node.statements.evaluate(cx, this);
		}
		if (node.imports != null && node.imports.size() > 0) {

			System.out.println("asd");
		}
		// out.println();
		return null;
	}

	@Override
	public Value evaluate(Context cx, BinaryProgramNode node) {
		// TODO Auto-generated method stub
		evaluate(cx, (ProgramNode) node);

		return null;
	}

	@Override
	public Value evaluate(Context cx, ClassDefinitionNode node) {

		if (node.name != null) {

			String name = NodeMagic.getClassName(node);

			if (name != null) {
				this.currentClassScope = new ClassSignature();
				classes.add(currentClassScope);
				if (pendingImports.size() != 0) {
					currentClassScope.imports.addAll(pendingImports);
					pendingImports.clear();
				}
				currentClassScope.name = name;
				currentClassScope.packageName = NodeMagic.getPackageName(node);

				if (node.baseclass != null) {
					String baseClass;
					if (node.baseclass instanceof MemberExpressionNode) {
						baseClass = NodeMagic
								.getIdentifier((MemberExpressionNode) node.baseclass).name;
					} else {
						baseClass = ((LiteralStringNode) node.baseclass).value;
					}

					currentClassScope.extendedFrom = resolveVariableType(baseClass);

				}
				// TODO Auto-generated method stub
				if (node.attrs != null) {
					node.attrs.evaluate(cx, this); // get
					// public/dynamic/private/final/internal
				}

				if (node.statements != null) {
					node.statements.evaluate(cx, this);
				}
			}
		}

		return null;
	}

	@Override
	public Value evaluate(Context cx, BinaryClassDefNode node) {
		evaluate(cx, (ClassDefinitionNode) node);// TODO Auto-generated method
		// stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, InterfaceDefinitionNode node) {
		// TODO Auto-generated method stub
		final InterfaceDefinitionNode in = node;
		InterfaceSignature interfaceSig = new InterfaceSignature();

		if (node.interfaces != null && node.interfaces.items != null) {
			String extendedInterfaceName;
			for (Node exp : node.interfaces.items) {

				interfaceSig.extendedFrom.add(NodeMagic
						.getIdentifier((MemberExpressionNode) exp).name);

			}
		}
		interfaceSig.access = getAccessFlagsFromDefinitionNode(node);
		interfaceSig.packageName = NodeMagic.getPackageName(node.pkgdef);
		interfaceSig.name = NodeMagic.getClassName(node);

		if (node.statements != null && node.statements.items != null) {
			for (Node func : node.statements.items) {
				if (func instanceof FunctionDefinitionNode)
					interfaceSig.methods.add(generateMethodSignature(cx,
							(FunctionDefinitionNode) func));
			}
		}
		if (currentClassScope != null) {
			currentClassScope.interfaces.add(interfaceSig);
		} else {
			classes.add((ClassBaseSignature) interfaceSig);
		}
		return null;
	}

	/**
	 * Resolves and variable declaredTyped into its full quallified name
	 * 
	 * @param type
	 * @return
	 */
	private String resolveVariableType(String type) {

		// TODO : Fix package wide method,vartypes
		if (currentClassScope == null)
			return type;

		if (type != "*" && currentClassScope.imports.size() > 0) {
			for (AS3Signature sig : currentClassScope.imports) {
				if (sig.name.endsWith(type)) {
					int endIndex = sig.name.lastIndexOf(".");

					if (endIndex != -1) {
						type = sig.name.substring(0, endIndex) + ":"
								+ sig.name.substring(endIndex + 1);
					} else {
						type = sig.name;
					}
					break;
				}
			}
		}
		return type;
	}

	private void populateSignatureIndices(AS3Signature sig,
			FunctionDefinitionNode node) {
		populateSignatureIndices(sig, node.cx.input, node.getPosition());
	}

	private void populateSignatureIndices(AS3Signature sig, InputBuffer input,
			int pos) {

		if (input == null)
			return;
		sig.charIndex = pos;
		sig.line = input.getLnNum(pos);
		sig.col = input.getColPos(pos);

	}

	public MethodSignature generateMethodSignature(Context cx,
			FunctionDefinitionNode node) {
		// TODO Auto-generated method stub
		MethodSignature method = new MethodSignature();
		// method.flags = getTypeFlagsFromNode(node);
		method.access = getAccessFlagsFromDefinitionNode(node);
		method.name = NodeMagic.getFunctionName(node);
		method.returnType = resolveVariableType(NodeMagic
				.getFunctionTypeName(node));
		populateSignatureIndices(method, node);

		if (method.returnType == "*")
			method.returnType = "void";

		final ParameterListNode params = node.fexpr.signature.parameter;
		if (params != null && params.size() > 0) {

			final int paramCount = params.size();
			ParameterNode pNode = null;

			VariableSignature var;
			for (int i = 0; i < paramCount; i++) {
				var = new VariableSignature();
				var.flags = Flags.TYPE_PARAMETER;
				pNode = params.items.get(i);
				var.declaredType = resolveVariableType(NodeMagic
						.getFunctionParamTypeName(node, i));
				var.name = pNode.identifier.name;

				if (pNode.init != null) {
					if (pNode.init instanceof LiteralNumberNode) {
						var.declaredValue = ((LiteralNumberNode) pNode.init).value;
					} else if (pNode.init instanceof LiteralNullNode) {
						var.declaredValue = "null";
					}

				}
				method.paramaters.add(var);

			}
		}
		return method;
	}

	@Override
	public Value evaluate(Context cx, FunctionDefinitionNode node) {

		// System.out.println(method.toString());
		// NodeMagic.getAttributes(node.attrs);
		if (currentClassScope != null) // TODO :fix package wide functions
			currentClassScope.methods.add(generateMethodSignature(cx, node));
		return null;
	}

	public int getAccessFlagsFromDefinitionNode(DefinitionNode node) {

		int flags = 0;
		Boolean atLeastOne = false;
		final List<String> attrs = NodeMagic.getAttributes(node.attrs);

		if (contains(attrs, "override")) {
			flags |= Flags.VISIBLITIY_OVERRIDE;
			atLeastOne = true;
		}
		if (contains(attrs, "protected")) {
			flags |= Flags.ACCESS_PROTECTED;
			atLeastOne = true;
		}
		if (contains(attrs, "public")) {
			flags |= Flags.ACCESS_PUBLIC;
			atLeastOne = true;
		}
		if (contains(attrs, "private")) {
			flags |= Flags.ACCESS_PRIVATE;
			atLeastOne = true;
		}
		if (contains(attrs, "internal")) {
			flags |= Flags.ACCESS_INTERNAL;
			atLeastOne = true;
		}
		if (contains(attrs, "static")) {
			flags |= Flags.VISIBLITIY_STATIC;
			atLeastOne = true;
		}
		if (contains(attrs, "native")) {
			flags |= Flags.VISIBLITIY_NATIVE;
			atLeastOne = true;
		}

		if (!atLeastOne) // default to public if we don't find any keywords
			flags |= Flags.ACCESS_PUBLIC;
		if (node instanceof FunctionDefinitionNode) {
			if (NodeMagic.functionIsGetter((FunctionDefinitionNode) node)) {
				flags |= Flags.VISIBLITIY_GETTER;
			} else if (NodeMagic
					.functionIsSetter((FunctionDefinitionNode) node)) {
				flags |= Flags.VISIBLITIY_SETTER;
			}
		}

		return flags;
	}

	public Boolean contains(final List list, Object value) {
		return (list.indexOf(value) > -1);
	}

	public int getTypeFlagsFromNode(DefinitionNode node) {
		int flags = 0;
		if (node instanceof VariableDefinitionNode) {
			flags |= ((VariableDefinitionNode) node).kind == CONST_TOKEN ? Flags.TYPE_CONST
					: Flags.TYPE_VARIABLE;
		}

		return flags;

	}

	@Override
	public Value evaluate(Context cx, VariableDefinitionNode node) {

		VariableSignature var = new VariableSignature();

		var.name = NodeMagic.getVariableName(node);
		var.access = getAccessFlagsFromDefinitionNode(node);
		var.flags = getTypeFlagsFromNode(node);

		var.declaredType = resolveVariableType(NodeMagic
				.getVariableTypeName(node));

		populateSignatureIndices(var, cx.input, node.getPosition());
		if(currentClassScope !=null)
		currentClassScope.variables.add(var);
		return null;
	}

	@Override
	public Value evaluate(Context cx, Node node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, IncrementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, DeleteExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, IdentifierNode node) {
		// TODO Auto-generated method stub

		return null;
	}

	@Override
	public Value evaluate(Context cx, InvokeNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ThisExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, QualifiedIdentifierNode node) {
		// TODO Auto-generated method stub

		return null;
	}

	@Override
	public Value evaluate(Context cx, QualifiedExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralBooleanNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralNumberNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralStringNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralNullNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralRegExpNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralXMLNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, FunctionCommonNode node) {
		// TODO Auto-generated method stub

		return null;
	}

	@Override
	public Value evaluate(Context cx, ParenExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ParenListExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralObjectNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralFieldNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralArrayNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LiteralVectorNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, SuperExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, SuperStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, MemberExpressionNode node) {
		// TODO Auto-generated method stub
		if (node.base != null) {
			node.base.evaluate(cx, this);
			out.print(".");
		}

		if (node.selector != null) {
			node.selector.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, CallExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, GetExpressionNode node) {
		// TODO Auto-generated method stub

		if (node.expr != null) {
			node.expr.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, SetExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ApplyTypeExprNode node) {
		// TODO Auto-generated method stub
		if (node.expr != null) {
			node.expr.evaluate(cx, this);
			out.print(".<"); // vector case
		}
		node.typeArgs.evaluate(cx, this);
		if (node.expr != null) {
			out.print(">");
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, UnaryExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, BinaryExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ConditionalExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ArgumentListNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ListNode node) {
		// TODO Auto-generated method stub
		for (Node n : node.items) {
			if (n != null) {
				n.evaluate(cx, this);
			}
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, StatementListNode node) {
		// TODO Auto-generated method stub

		int items = node.items.size();

		Node currNode = null;
		for (int i = 0; i < items; i++) {
			currNode = node.items.get(i);
			if (currNode instanceof ImportDirectiveNode) {
				ImportSignature importSig = new ImportSignature(NodeMagic
						.getDottedImportName((ImportDirectiveNode) currNode));
				if (currentClassScope == null) {
					pendingImports.add(importSig);
				} else {
					currentClassScope.imports.add(importSig);
				}

			} else if (currNode instanceof ClassDefinitionNode) {
				currNode.evaluate(cx, this);

			} else if (currNode instanceof FunctionDefinitionNode) {
				evaluate(cx, (FunctionDefinitionNode) currNode);
			} else if (currNode instanceof VariableDefinitionNode) {
				evaluate(cx, (VariableDefinitionNode) currNode);
			} else if (currNode instanceof InterfaceDefinitionNode) {
				evaluate(cx, (InterfaceDefinitionNode) currNode);
			} else {
				currNode.evaluate(cx, this);
			}

		}

		return null;
	}

	@Override
	public Value evaluate(Context cx, EmptyElementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, EmptyStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ExpressionStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LabeledStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, IfStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, SwitchStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, CaseLabelNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, DoStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, WhileStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ForStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, WithStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ContinueStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, BreakStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ReturnStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ThrowStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, TryStatementNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, CatchClauseNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, FinallyClauseNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, UseDirectiveNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, IncludeDirectiveNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ImportNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, MetaDataNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, DocCommentNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ImportDirectiveNode node) {
		// TODO Auto-generated method stub

		return null;
	}

	@Override
	public Value evaluate(Context cx, AttributeListNode node) {
		// TODO Auto-generated method stub
		for (Node n : node.items) {
			n.evaluate(cx, this);
			out.print(" ");
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, VariableBindingNode node) {
		// TODO Auto-generated method stub
		if (node.variable != null) {
			node.variable.evaluate(cx, this);
		}
		separate();
		if (node.initializer != null) {
			node.initializer.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, UntypedVariableBindingNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, TypedIdentifierNode node) {
		// TODO Auto-generated method stub
		if (node.identifier != null) { // get variable name
			node.identifier.evaluate(cx, this);
		}

		if (node.type != null) { // get declare type
			out.print(" : ");
			node.type.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, TypeExpressionNode node) {
		// TODO Auto-generated method stub
		if (node.expr != null) {

			node.expr.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, BinaryFunctionDefinitionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, FunctionNameNode node) {
		// TODO Auto-generated method stub
		out.print(node.kind == GET_TOKEN ? "get "
				: node.kind == SET_TOKEN ? "set " : "");
		if (node.identifier != null) {
			node.identifier.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, FunctionSignatureNode node) {
		out.print("(");
		// TODO Auto-generated method stub
		if (node.parameter != null) {
			node.parameter.evaluate(cx, this);
		}

		out.print(")");
		if (node.result != null) {
			node.result.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, ParameterNode node) {
		// TODO Auto-generated method stub
		if (node.identifier != null) {
			node.identifier.evaluate(cx, this); // get paramater name
		}
		if (node.type != null) {
			out.print(" : ");
			node.type.evaluate(cx, this);
		}
		if (node.init != null) {
			out.print("=");
			node.init.evaluate(cx, this);
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, ParameterListNode node) {
		// TODO Auto-generated method stub

		final int size = node.items.size();
		for (int i = 0; i < size; i++) {

			ParameterNode n = node.items.get(i);
			if (n != null) {
				n.evaluate(cx, this);

				if (i < size - 1) {
					out.print(','); //
				}

			}
		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, RestExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, RestParameterNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, BinaryInterfaceDefinitionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ClassNameNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, InheritanceNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, NamespaceDefinitionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ConfigNamespaceDefinitionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, PackageDefinitionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, PackageIdentifiersNode node) {
		// TODO Auto-generated method stub
		for (IdentifierNode n : node.list) {
			n.evaluate(cx, this);

		}
		return null;
	}

	@Override
	public Value evaluate(Context cx, PackageNameNode node) {
		// TODO Auto-generated method stub
		if (node.id != null) {
			node.id.evaluate(cx, this);
		}
		// out.print(node.id.toIdentifierString());
		return null;
	}

	@Override
	public Value evaluate(Context cx, ErrorNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, ToObjectNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, LoadRegisterNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, StoreRegisterNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, RegisterNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, HasNextNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, BoxNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, CoerceNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, PragmaNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, UsePrecisionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, UseNumericNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, UseRoundingNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, PragmaExpressionNode node) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Value evaluate(Context cx, DefaultXMLNamespaceNode node) {
		// TODO Auto-generated method stub
		return null;
	}

}
